package cn.niit.pm.controller;

import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpSession;
/*
 * fahui
 * 退出系统Controller
 * */
@Api(value = "测试接口", tags = "退出接口")
@Controller
public class LogoutController {
    @GetMapping("/logout")
    public String logout(HttpSession session){
        //1、首先销毁缓存session
        session.removeAttribute("employee");
        //2、其次返回到login界面
        return "redirect:/login";   //走重定向
    }
}
